home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / mask.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  9.2 KB  |  238 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'Mask.pas' rev: 3.00
  6.  
  7. #ifndef MaskHPP
  8. #define MaskHPP
  9. #include <Menus.hpp>
  10. #include <Graphics.hpp>
  11. #include <Forms.hpp>
  12. #include <Messages.hpp>
  13. #include <Controls.hpp>
  14. #include <StdCtrls.hpp>
  15. #include <Classes.hpp>
  16. #include <SysUtils.hpp>
  17. #include <Windows.hpp>
  18. #include <SysInit.hpp>
  19. #include <System.hpp>
  20.  
  21. //-- user supplied -----------------------------------------------------------
  22.  
  23. namespace Mask
  24. {
  25. //-- type declarations -------------------------------------------------------
  26. enum TMaskCharType { mcNone, mcLiteral, mcIntlLiteral, mcDirective, mcMask, mcMaskOpt, mcFieldSeparator, 
  27.     mcField };
  28.  
  29. enum Mask__1 { mdReverseDir, mdUpperCase, mdLowerCase, mdLiteralChar };
  30.  
  31. typedef Set<Mask__1, mdReverseDir, mdLiteralChar>  TMaskDirectives;
  32.  
  33. class DELPHICLASS EDBEditError;
  34. class PASCALIMPLEMENTATION EDBEditError : public Sysutils::Exception 
  35. {
  36.     typedef Sysutils::Exception inherited;
  37.     
  38. public:
  39.     /* Exception.Create */ __fastcall EDBEditError(const System::AnsiString Msg) : Sysutils::Exception(
  40.         Msg) { }
  41.     /* Exception.CreateFmt */ __fastcall EDBEditError(const System::AnsiString Msg, const System::TVarRec 
  42.         * Args, const int Args_Size) : Sysutils::Exception(Msg, Args, Args_Size) { }
  43.     /* Exception.CreateRes */ __fastcall EDBEditError(int Ident, Extended Dummy) : Sysutils::Exception(
  44.         Ident, Dummy) { }
  45.     /* Exception.CreateResFmt */ __fastcall EDBEditError(int Ident, const System::TVarRec * Args, const 
  46.         int Args_Size) : Sysutils::Exception(Ident, Args, Args_Size) { }
  47.     /* Exception.CreateHelp */ __fastcall EDBEditError(const System::AnsiString Msg, int AHelpContext) : 
  48.         Sysutils::Exception(Msg, AHelpContext) { }
  49.     /* Exception.CreateFmtHelp */ __fastcall EDBEditError(const System::AnsiString Msg, const System::TVarRec 
  50.         * Args, const int Args_Size, int AHelpContext) : Sysutils::Exception(Msg, Args, Args_Size, AHelpContext
  51.         ) { }
  52.     /* Exception.CreateResHelp */ __fastcall EDBEditError(int Ident, int AHelpContext) : Sysutils::Exception(
  53.         Ident, AHelpContext) { }
  54.     /* Exception.CreateResFmtHelp */ __fastcall EDBEditError(int Ident, const System::TVarRec * Args, const 
  55.         int Args_Size, int AHelpContext) : Sysutils::Exception(Ident, Args, Args_Size, AHelpContext) { }
  56.     
  57. public:
  58.     /* TObject.Destroy */ __fastcall virtual ~EDBEditError(void) { }
  59.     
  60. };
  61.  
  62. enum Mask__3 { msMasked, msReEnter, msDBSetText };
  63.  
  64. typedef Set<Mask__3, msMasked, msDBSetText>  TMaskedState;
  65.  
  66. class DELPHICLASS TCustomMaskEdit;
  67. class PASCALIMPLEMENTATION TCustomMaskEdit : public Stdctrls::TCustomEdit 
  68. {
  69.     typedef Stdctrls::TCustomEdit inherited;
  70.     
  71. private:
  72.     System::AnsiString FEditMask;
  73.     char FMaskBlank;
  74.     int FMaxChars;
  75.     bool FMaskSave;
  76.     TMaskedState FMaskState;
  77.     int FCaretPos;
  78.     int FBtnDownX;
  79.     System::AnsiString FOldValue;
  80.     bool __fastcall DoInputChar(char &NewChar, int MaskOffset);
  81.     bool __fastcall Validate(const System::AnsiString Value, int &Pos);
  82.     bool __fastcall InputChar(char &NewChar, int Offset);
  83.     bool __fastcall DeleteSelection(System::AnsiString &Value, int Offset, int Len);
  84.     int __fastcall InputString(System::AnsiString &Value, const System::AnsiString NewValue, int Offset
  85.         );
  86.     System::AnsiString __fastcall AddEditFormat(const System::AnsiString Value, bool Active);
  87.     System::AnsiString __fastcall RemoveEditFormat(const System::AnsiString Value);
  88.     int __fastcall FindLiteralChar(int MaskOffset, char InChar);
  89.     System::AnsiString __fastcall GetEditText(void);
  90.     bool __fastcall GetMasked(void);
  91.     HIDESBASE System::AnsiString __fastcall GetText(void);
  92.     int __fastcall GetMaxLength(void);
  93.     bool __fastcall CharKeys(char &CharCode);
  94.     void __fastcall SetEditText(const System::AnsiString Value);
  95.     void __fastcall SetEditMask(const System::AnsiString Value);
  96.     HIDESBASE void __fastcall SetMaxLength(int Value);
  97.     HIDESBASE void __fastcall SetText(const System::AnsiString Value);
  98.     void __fastcall DeleteKeys(Word CharCode);
  99.     void __fastcall HomeEndKeys(Word CharCode, Classes::TShiftState Shift);
  100.     void __fastcall CursorInc(int CursorPos, int Incr);
  101.     void __fastcall CursorDec(int CursorPos);
  102.     void __fastcall ArrowKeys(Word CharCode, Classes::TShiftState Shift);
  103.     HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
  104.     HIDESBASE MESSAGE void __fastcall WMLButtonUp(Messages::TWMMouse &Message);
  105.     HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  106.     MESSAGE void __fastcall WMCut(Messages::TMessage &Message);
  107.     MESSAGE void __fastcall WMPaste(Messages::TMessage &Message);
  108.     HIDESBASE MESSAGE void __fastcall CMEnter(Messages::TWMNoParams &Message);
  109.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
  110.     HIDESBASE MESSAGE void __fastcall CMTextChanged(Messages::TMessage &Message);
  111.     MESSAGE void __fastcall CMWantSpecialKey(Messages::TWMKey &Message);
  112.     
  113. protected:
  114.     void __fastcall ReformatText(const System::AnsiString NewMask);
  115.     void __fastcall GetSel(int &SelStart, int &SelStop);
  116.     void __fastcall SetSel(int SelStart, int SelStop);
  117.     HIDESBASE void __fastcall SetCursor(int Pos);
  118.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  119.     DYNAMIC void __fastcall KeyUp(Word &Key, Classes::TShiftState Shift);
  120.     DYNAMIC void __fastcall KeyPress(char &Key);
  121.     virtual bool __fastcall EditCanModify(void);
  122.     virtual void __fastcall Reset(void);
  123.     int __fastcall GetFirstEditChar(void);
  124.     int __fastcall GetLastEditChar(void);
  125.     int __fastcall GetNextEditChar(int Offset);
  126.     int __fastcall GetPriorEditChar(int Offset);
  127.     int __fastcall GetMaxChars(void);
  128.     void __fastcall ValidateError(void);
  129.     void __fastcall CheckCursor(void);
  130.     __property System::AnsiString EditMask = {read=FEditMask, write=SetEditMask};
  131.     __property TMaskedState MaskState = {read=FMaskState, write=FMaskState, nodefault};
  132.     __property int MaxLength = {read=GetMaxLength, write=SetMaxLength, default=0};
  133.     
  134. public:
  135.     __fastcall virtual TCustomMaskEdit(Classes::TComponent* AOwner);
  136.     void __fastcall ValidateEdit(void);
  137.     HIDESBASE void __fastcall Clear(void);
  138.     HIDESBASE int __fastcall GetTextLen(void);
  139.     __property bool IsMasked = {read=GetMasked, nodefault};
  140.     __property System::AnsiString EditText = {read=GetEditText, write=SetEditText};
  141.     __property System::AnsiString Text = {read=GetText, write=SetText};
  142. public:
  143.     /* TWinControl.CreateParented */ __fastcall TCustomMaskEdit(HWND ParentWindow) : Stdctrls::TCustomEdit(
  144.         ParentWindow) { }
  145.     /* TWinControl.Destroy */ __fastcall virtual ~TCustomMaskEdit(void) { }
  146.     
  147. };
  148.  
  149. class DELPHICLASS TMaskEdit;
  150. class PASCALIMPLEMENTATION TMaskEdit : public Mask::TCustomMaskEdit 
  151. {
  152.     typedef Mask::TCustomMaskEdit inherited;
  153.     
  154. __published:
  155.     __property AutoSelect ;
  156.     __property AutoSize ;
  157.     __property BorderStyle ;
  158.     __property CharCase ;
  159.     __property Color ;
  160.     __property Ctl3D ;
  161.     __property DragCursor ;
  162.     __property DragMode ;
  163.     __property Enabled ;
  164.     __property EditMask ;
  165.     __property Font ;
  166.     __property ImeMode ;
  167.     __property ImeName ;
  168.     __property MaxLength ;
  169.     __property ParentColor ;
  170.     __property ParentCtl3D ;
  171.     __property ParentFont ;
  172.     __property ParentShowHint ;
  173.     __property PasswordChar ;
  174.     __property PopupMenu ;
  175.     __property ReadOnly ;
  176.     __property ShowHint ;
  177.     __property TabOrder ;
  178.     __property TabStop ;
  179.     __property Text ;
  180.     __property Visible ;
  181.     __property OnChange ;
  182.     __property OnClick ;
  183.     __property OnDblClick ;
  184.     __property OnDragDrop ;
  185.     __property OnDragOver ;
  186.     __property OnEndDrag ;
  187.     __property OnEnter ;
  188.     __property OnExit ;
  189.     __property OnKeyDown ;
  190.     __property OnKeyPress ;
  191.     __property OnKeyUp ;
  192.     __property OnMouseDown ;
  193.     __property OnMouseMove ;
  194.     __property OnMouseUp ;
  195.     __property OnStartDrag ;
  196. public:
  197.     /* TCustomMaskEdit.Create */ __fastcall virtual TMaskEdit(Classes::TComponent* AOwner) : Mask::TCustomMaskEdit(
  198.         AOwner) { }
  199.     
  200. public:
  201.     /* TWinControl.CreateParented */ __fastcall TMaskEdit(HWND ParentWindow) : Mask::TCustomMaskEdit(ParentWindow
  202.         ) { }
  203.     /* TWinControl.Destroy */ __fastcall virtual ~TMaskEdit(void) { }
  204.     
  205. };
  206.  
  207. //-- var, const, procedure ---------------------------------------------------
  208. extern PACKAGE char DefaultBlank;
  209. extern PACKAGE char MaskFieldSeparator;
  210. extern PACKAGE char MaskNoSave;
  211. #define mDirReverse (char)(33)
  212. #define mDirUpperCase (char)(62)
  213. #define mDirLowerCase (char)(60)
  214. #define mDirLiteral (char)(92)
  215. #define mMskAlpha (char)(76)
  216. #define mMskAlphaOpt (char)(108)
  217. #define mMskAlphaNum (char)(65)
  218. #define mMskAlphaNumOpt (char)(97)
  219. #define mMskAscii (char)(67)
  220. #define mMskAsciiOpt (char)(99)
  221. #define mMskNumeric (char)(48)
  222. #define mMskNumericOpt (char)(57)
  223. #define mMskNumSymOpt (char)(35)
  224. #define mMskTimeSeparator (char)(58)
  225. #define mMskDateSeparator (char)(47)
  226. extern PACKAGE bool __fastcall MaskGetMaskSave(const System::AnsiString EditMask);
  227. extern PACKAGE char __fastcall MaskGetMaskBlank(const System::AnsiString EditMask);
  228. extern PACKAGE int __fastcall MaskGetFldSeparator(const System::AnsiString EditMask);
  229. extern PACKAGE System::AnsiString __fastcall FormatMaskText(const System::AnsiString EditMask, const 
  230.     System::AnsiString Value);
  231.  
  232. }    /* namespace Mask */
  233. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  234. using namespace Mask;
  235. #endif
  236. //-- end unit ----------------------------------------------------------------
  237. #endif    // Mask
  238.